package ModelLayer;
import java.util.*;

/**
 * Write a description of class DVD here.
 * 
 * @author (Group2) 
 * @version (8)
 */
public class DVD
{
    //start of instance variables;
    public String id;
    public String title;
    private String artist;
    private String publicationDate;
    public ArrayList<Copy> copies;
    //end of instance variables;
    public DVD(String id, String title, String artist, String publicationDate)      //constructor of the class DVD;
    {
        this.id=id;
        this.title=title;
        this.artist=artist;
        this.publicationDate=publicationDate;
        copies=new ArrayList();
    }

    public void createDVD(String id, String title, String artist, String publicationDate)       //creating an object of class DVD;
    {
        this.id=id;
        this.title=title;
        this.artist=artist;
        this.publicationDate=publicationDate;
    }

    public void createCopy(int serialNumber, String purchaseDate, int purchasePrice, String state)      //creates an object of class Copy and puts it into the DVDs arraylist;
    {
        Copy copy=new Copy(serialNumber, purchaseDate, purchasePrice, state);
        copies.add(copy);
    }

    public void addCopy(Copy copy)      //add the copy to the DVDs arraylist;
    {
        copies.add(copy);    
    }
    //start of set/mutator methods;
    public void setID(String id)       
    {
        this.id=id;    
    }

    public void setTitle(String title)
    {
        this.title=title;
    }

    public void setArtist(String artist)
    {
        this.artist=artist;
    }

    public void setPublicationDate(String publicationDate)
    {
        this.publicationDate=publicationDate;    
    }
    //end of set/mutator methods;
    
    //start of get/accessor methods;
    public void getID()
    {
        System.out.println("ID : " + id);
    }

    public void getTitle()
    {
        System.out.println("Title : " + title);
    }

    public void getArtist()
    {
        System.out.println("Artist : " + artist);
    }

    public void getPublicationDate()
    {
        System.out.println("PublicationDate : " + publicationDate);  
        System.out.println("********************************");   
    }
    //end of get/accessor methods;
    public void print()     //prints our the information about the DVD;
    {
        getID();
        getTitle();
        getArtist();
        getPublicationDate();
        System.out.println("********************************");   
    }
    
    public void getCopies()     //returns the copies of the DVD;
    {
        for(Copy a: copies)
        {
            a.print();
        }
    }

    public ArrayList<Copy> getCopyList()        //returns the ArrayList of copies the dvd has;
    {
        return copies;
    }

    public ArrayList<Copy> getList()        //returns the ArrayList of copies the dvd has;
    {
        return copies;
    }
}
